package com.lagou.bean;

import com.lagou.service.HelloService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

@Component
public class ConsumerComponent {

    @Reference
    //(mock = "force:return 1234")
   // @Reference(loadbalance = "onlyFirst")
    private HelloService helloService;

    public String sayHelloA(String name, int timeToWait) {
        System.out.println("调用方法A....");
        System.out.println(helloService.methodA("helloA",100));
        System.out.println("调用A完成。。。。");
        return "调用完成。。。。";
    }
    public String sayHelloB(String name, int timeToWait) {

        System.out.println("调用方法B....");
        System.out.println(helloService.methodB("helloB",100));
        System.out.println("调用B完成。。。。");

        return "调用完成。。。。";
    }
    public String sayHelloC(String name, int timeToWait) {
        System.out.println("调用方法C....");
        System.out.println(helloService.methodC("helloC",100));
        System.out.println("调用C完成。。。。");

        return "调用完成。。。。";
    }
}
